package com.drinks.yiniang.entity.goods;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.hansen.library.entity.BaseJson;

import java.util.List;

/**
 * 首页商品数据
 * @author han
 * @date 2019/9/2
 */
public class HomeGoodsJson extends BaseJson {

    public static final String TYPE_HOME_GOODS_DATA = "0";//商品数据
    public static final String TYPE_HOME_GOODS_BANNER = "1";//banner

    public static final int ITEM_TYPE_HOME_GOODS_LIST = 0x01;
    public static final int ITEM_TYPE_HOME_AD_LIST = 0x02;

    private HomeGoodsData data;

    public HomeGoodsData getData() {
        return data;
    }

    public void setData(HomeGoodsData data) {
        this.data = data;
    }


    public static class HomeGoodsData {
        private List<HomeGoodsList> data;

        public List<HomeGoodsList> getData() {
            return data;
        }

        public void setData(List<HomeGoodsList> data) {
            this.data = data;
        }
    }

    public static class HomeGoodsList extends GoodsJson.GoodsList implements MultiItemEntity {

        //Banner图type类型: 0-商品；1-酒单；2-套餐；3-分类；4-活动；5-社区文章；6-智能推荐）
        private String type;
        private String title;
        private String sub_title;

        //类型  0表示商品  1表示Banner
        private String show_type;
        //库存
        private String stock;
        //Banner图对应打开链接的详情ID
        private String value;

        @Override
        public int getItemType() {
            return TYPE_HOME_GOODS_BANNER.equals(show_type) ? ITEM_TYPE_HOME_AD_LIST : ITEM_TYPE_HOME_GOODS_LIST;
        }

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getSub_title() {
            return sub_title;
        }

        public void setSub_title(String sub_title) {
            this.sub_title = sub_title;
        }

        public String getShow_type() {
            return show_type;
        }

        public void setShow_type(String show_type) {
            this.show_type = show_type;
        }

        public String getStock() {
            return stock;
        }

        public void setStock(String stock) {
            this.stock = stock;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
}
